### Mount files as secrets

The following Dagger Function accepts a GitHub hosts configuration file as a `Secret`, and mounts the file as a `Secret` to a container to authorize a request to GitHub.

<Tabs groupId="language" queryString="sdk">
<TabItem value="go" label="Go">

```go file=../../../cookbook/snippets/secret-file/go/main.go
```

</TabItem>
<TabItem value="python" label="Python">

```python file=../../../cookbook/snippets/secret-file/python/main.py
```

</TabItem>
<TabItem value="typescript" label="TypeScript">

```typescript file=../../../cookbook/snippets/secret-file/typescript/index.ts
```

</TabItem>
</Tabs>

#### Mounting files

To mount a file as a secret, you can use the following:

<Tabs groupId="shell">
<TabItem value="System shell">
```shell
dagger -c 'github-auth file://$HOME/.config/gh/hosts.yml'
```
</TabItem>
<TabItem value="Dagger Shell">
```shell title="First type 'dagger' for interactive mode."
github-auth file://$HOME/.config/gh/hosts.yml
```
</TabItem>
<TabItem value="Dagger CLI">
```shell
dagger call github-auth --gh-creds=file://$HOME/.config/gh/hosts.yml
```
</TabItem>
</Tabs>
